<!-- 区级儿童救助申请审批 -->
<template>
  <div>
    <el-card>
      <el-row>
        <el-form ref="form" :model="searchDto" inline label-suffix=":">
          <el-form-item label="关键字" prop="assistEquName">
            <el-input
              v-model="searchDto.assistEquName"
              placeholder="请输入关键字"
              style="width: 250px"
            ></el-input>
          </el-form-item>
          <el-form-item>
            <el-button icon="el-icon-search" type="primary" @click="search"
              >查询</el-button
            >
          </el-form-item>
          <el-form-item>
            <el-button icon="el-icon-s-open" type="primary" @click="clear"
              >重置</el-button
            >
          </el-form-item>
          <!-- <el-form-item>
            <el-button icon="el-icon-plus" type="primary" @click="addAppliance"
              >新增课程</el-button
            >
          </el-form-item> -->
        </el-form>
      </el-row>
      <page-table
        ref="recovery"
        :page-data="pageData"
        :loading="loading"
        :do-get-page-data="getPageData"
      >
        <el-table-column type="index" label="编号" width="80" align="center" />
        <el-table-column prop="assistEquName" label="儿童姓名" align="center" />
        <el-table-column prop="categoryName" label="申请人" align="center" />
        <el-table-column prop="categoryName" label="申请方式" align="center" />
        <el-table-column
          prop="categoryName"
          label="监护人姓名"
          align="center"
        />
        <el-table-column
          prop="categoryName"
          label="监护人手机号"
          align="center"
        />
        <el-table-column
          prop="categoryName"
          label="监护人姓名"
          align="center"
        />
        <el-table-column prop="categoryName" label="救助类型" align="center" />
        <el-table-column prop="createTime" label="申请时间" align="center" />
        <el-table-column prop="createTime" label="结束时间" align="center" />
        <el-table-column prop="categoryName" label="审核状态" align="center" />
        <el-table-column label="操作" align="center" width="300" fixed="right">
          <template slot-scope="scope">
            <el-tooltip content="详情" placement="top">
              <el-button
                type="button"
                size="mini"
                icon="el-icon-search"
                @click="view(scope.row)"
              >
              </el-button>
            </el-tooltip>
            <el-tooltip content="审核" placement="top">
              <el-button
                type="button"
                size="mini"
                icon="el-icon-edit"
                @click="appliance(scope.row)"
              >
              </el-button>
            </el-tooltip>
          </template>
        </el-table-column>
      </page-table>
    </el-card>
    <!-- 审批 -->
    <el-dialog title="审核" :visible.sync="dialogVisible" width="30%" center>
      <el-form :model="form">
        <el-form-item label="审核结果：" prop="sex">
          <el-radio-group v-model="form.sex">
            <el-radio label="通过"></el-radio>
            <el-radio label="未通过"></el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="审核意见：" prop="assistEquName">
          <el-input
            type="textarea"
            :autosize="{ minRows: 4 }"
            v-model="form.rangeDesc"
            placeholder="请输审核意见"
          />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
            <el-button @click="dialogVisible = false">取 消</el-button>
            <el-button type="primary" @click="deteermineHandle">确 定</el-button>
        </div>
    </el-dialog>
  </div>
</template>
<script>
export default {
  name: "region",
  data() {
    return {
      sex: "",
      dialogVisible: false,
      pageData: {},
      loading: false,
      form:{},
      searchDto: {
        assistEquName: null,
        disabledTypeId: null,
        cid: null,
      },
      switchValue: true,
    };
  },
  methods: {
    // 获取分页数据
    getPageData(val) {
      let tem = Object.assign(this.searchDto, val);
      this.API.getAssistEquInfoPageList(tem).then((ret) => {
        // 接口地址需更新
        this.pageData = ret.data;
      });
    },

    // 查询
    search() {
      this.getPageData();
    },

    //清空
    clear() {
      this.$refs.form.resetFields();
      this.getPageData();
    },
    //   详情
    view({ id }) {
      this.$router.push({ name: "approveDetail", query: { id } });
    },
    // 审批
    appliance({ row }) {
        this.dialogVisible = true;
    },
    // 审批确认
    deteermineHandle(){

    }
  },
  mounted() {
    this.getPageData();
  },
};
</script>
  <style scoped lang="scss"></style>
        